<template>
  <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pageNum"
      :page-sizes="[5, 10, 20, 50]"
      :page-size="pageSize"

      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>
<script>
export default {
  props: {
    total: {
      type: Number,
      default: () => 0,
    },
    pageNum: {
      type: Number,
      default: () => 0,
    },
  },
  methods: {
    handleSizeChange(val) {
      this.$emit('changePageSize',val);
      console.log(val);
    },
    handleCurrentChange(val) {
      this.$emit('changePageNum',val);
      console.log(val)
    },
  },
  data() {
    return {
      pageSize: 10,
    };
  },
};
</script>